package com.chinamsp.dydb.dbsource;

import java.util.Map;

import javax.sql.DataSource;

/**
 * 数据源实例
 * @author shifenghu
 *
 */
public class DataSourceImpl {

	/**
	 * 数据库源实例
	 */
	private DataSource datasource;
	
	/**
	 * 用户名
	 */
	private String username;
	
	/**
	 * 密码
	 */
	private String password;
	
	/**
	 * url
	 */
	private String url;
	
	/**
	 * 驱动类型
	 */
	private String driverClassName;
	
	/**
	 * 数据源 testbean name
	 */
	private String beanName;
	
	/**
	 * 扩展属性
	 */
	private Map<String, Object> properties;
	
	
	
	public DataSourceImpl() {}
	
	
	/**
	 * 透过所有参数初始化一个数据源
	 * @param username
	 * @param password
	 * @param url
	 * @param driverClassName
	 * @param properties
	 */
	public DataSourceImpl(String username, String password, String url, String driverClassName, Map<String, Object> properties) {
		this.username = username;
		this.password = password;
		this.url = url;
		this.driverClassName = driverClassName;
		this.properties = properties;
	}

	public DataSource getDatasource() {
		return datasource;
	}

	public void setDatasource(DataSource datasource) {
		this.datasource = datasource;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Map<String, Object> getProperties() {
		return properties;
	}

	public void setProperties(Map<String, Object> properties) {
		this.properties = properties;
	}

	public String getDriverClassName() {
		return driverClassName;
	}

	public void setDriverClassName(String driverClassName) {
		this.driverClassName = driverClassName;
	}

	public String getBeanName() {
		return beanName;
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}
	
	
}
